/** 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package it.free.i.virtual.machine.tools;

import java.io.FileInputStream;
import java.util.Properties;

/**  
 * @author stefano
 */
public class PropertyLoader {

	/**
	 * Not accessible
	 */
	private PropertyLoader() {
	}

	/**
	 * Load properties from a plain properties file
	 * @param propertyFileName is the full path and file name for the property file to load
	 * @return properties found in the file
	 * @throws Exception
	 */
	public static final Properties loadProperties(String propertyFileName) throws Exception{
		
		Properties properties = null;
		FileInputStream fileInputStream = null;
		
		try{
			fileInputStream = new FileInputStream(propertyFileName);
			properties = new Properties();
			properties.load(fileInputStream);
		}finally{
			     if(fileInputStream != null){
			    	 fileInputStream.close();
			     }
		}
		return properties;
	}
	
}
